package com.medisign.sign.log.dao;

import com.medisign.sign.log.pojo.TbSignFile;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
import java.util.Date;
import java.util.List;

/**
 * 文件签名
 */
public interface TbSignFileDao extends JpaRepository<TbSignFile, Long>, JpaSpecificationExecutor<TbSignFile> {

    TbSignFile findByFileCodeAndStrategy(String fileCode, String strategy);

    TbSignFile findByIdAndStrategy(Long id, String strategy);

    List<TbSignFile> findByOrderCode(String orderCode);

    List<TbSignFile> findByOrderCodeAndStrategy(String orderCode, String strategy);

    void deleteByIdAndStrategy(long id, String strategy);

    List<TbSignFile> findByCreateTimeAfterAndStrategyAfter(Date date, String strategy);

    List<TbSignFile> findByCreateTimeBeforeAndStrategyBefore(Date date, String strategy);

    List<TbSignFile> findByCreateTimeBetweenAndStrategyBetween(Date startDate, Date endDate, String start, String end);

    TbSignFile findByFileCode(String fileCode);

}
